package com.isoft.permanprovidor.controller.sgman;

import com.isoft.permanprovidor.bean.ResponseData;
import com.isoft.permanprovidor.controller.BaseController;
import com.isoft.permanprovidor.entity.sgman.ExterPerson;
import com.isoft.permanprovidor.entity.sgman.ExterPersonContract;
import com.isoft.permanprovidor.service.sgman.ExterPersonContract_Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/permanprovidor/exterpersoncontract")
public class ExterPersonContract_Controller extends BaseController {
    @Autowired
    ExterPersonContract_Service exterPersonContract_service;
    /*分页综合查询操作*/
    @PostMapping("/getpage")
    public ResponseData PageSynthSelect(Integer current , Integer size, String name , String contractstartdate , String contracttype){
        return exterPersonContract_service.PageSynthSelect(current,size,name,contractstartdate,contracttype);
    }
    /*新增外聘人员合同*/
    @PostMapping("/add")
    public ResponseData<Boolean> add(ExterPersonContract exterPersonContract){
        return returnBoolean(exterPersonContract_service.add(exterPersonContract));
    }
    /*修改外聘人员信息*/
    @PutMapping("/update")
    public ResponseData<Boolean> update(@RequestBody ExterPersonContract exterPersonContract){
        return  returnBoolean(exterPersonContract_service.update(exterPersonContract));
    }
    /*启/停用该外聘人员*/
    @PostMapping("/freezeenable")
    public ResponseData<Boolean> islock (Integer id ,String sysuserid,Integer islock){
        return returnBoolean(exterPersonContract_service.islock(id, sysuserid, islock));
    }


}
